// SCSS variables are information about icon's compiled state, stored under its original file name
//
// .icon-home {
//   width: $icon-home-width;
// }
//
// The large array-like variables contain all information about a single icon
// $icon-home: x y offset_x offset_y width height total_width total_height image_path;
//
// At the bottom of this section, we provide information about the spritesheet itself
// $spritesheet: width height image $spritesheet-sprites;
$gts-eg-name: 'gtsEg';
$gts-eg-x: 0px;
$gts-eg-y: 0px;
$gts-eg-offset-x: 0px;
$gts-eg-offset-y: 0px;
$gts-eg-width: 147px;
$gts-eg-height: 107px;
$gts-eg-total-width: 191px;
$gts-eg-total-height: 584px;
$gts-eg-image: 'sprite_pm.png';
$gts-eg: (0px, 0px, 0px, 0px, 147px, 107px, 191px, 584px, 'sprite_pm.png', 'gtsEg', );
$gts-qrcode-name: 'gtsQrcode';
$gts-qrcode-x: 0px;
$gts-qrcode-y: 117px;
$gts-qrcode-offset-x: 0px;
$gts-qrcode-offset-y: -117px;
$gts-qrcode-width: 110px;
$gts-qrcode-height: 108px;
$gts-qrcode-total-width: 191px;
$gts-qrcode-total-height: 584px;
$gts-qrcode-image: 'sprite_pm.png';
$gts-qrcode: (0px, 117px, 0px, -117px, 110px, 108px, 191px, 584px, 'sprite_pm.png', 'gtsQrcode', );
$mt4-android-name: 'mt4Android';
$mt4-android-x: 0px;
$mt4-android-y: 235px;
$mt4-android-offset-x: 0px;
$mt4-android-offset-y: -235px;
$mt4-android-width: 110px;
$mt4-android-height: 108px;
$mt4-android-total-width: 191px;
$mt4-android-total-height: 584px;
$mt4-android-image: 'sprite_pm.png';
$mt4-android: (0px, 235px, 0px, -235px, 110px, 108px, 191px, 584px, 'sprite_pm.png', 'mt4Android', );
$mt4-eg-name: 'mt4Eg';
$mt4-eg-x: 0px;
$mt4-eg-y: 471px;
$mt4-eg-offset-x: 0px;
$mt4-eg-offset-y: -471px;
$mt4-eg-width: 191px;
$mt4-eg-height: 113px;
$mt4-eg-total-width: 191px;
$mt4-eg-total-height: 584px;
$mt4-eg-image: 'sprite_pm.png';
$mt4-eg: (0px, 471px, 0px, -471px, 191px, 113px, 191px, 584px, 'sprite_pm.png', 'mt4Eg', );
$mt4-ios-name: 'mt4Ios';
$mt4-ios-x: 0px;
$mt4-ios-y: 353px;
$mt4-ios-offset-x: 0px;
$mt4-ios-offset-y: -353px;
$mt4-ios-width: 110px;
$mt4-ios-height: 108px;
$mt4-ios-total-width: 191px;
$mt4-ios-total-height: 584px;
$mt4-ios-image: 'sprite_pm.png';
$mt4-ios: (0px, 353px, 0px, -353px, 110px, 108px, 191px, 584px, 'sprite_pm.png', 'mt4Ios', );
$spritesheet-width: 191px;
$spritesheet-height: 584px;
$spritesheet-image: 'sprite_pm.png';
$spritesheet-sprites: ($gts-eg, $gts-qrcode, $mt4-android, $mt4-eg, $mt4-ios, );
$spritesheet: (191px, 584px, 'sprite_pm.png', $spritesheet-sprites, );

// The provided mixins are intended to be used with the array-like variables
//
// .icon-home {
//   @include sprite-width($icon-home);
// }
//
// .icon-email {
//   @include sprite($icon-email);
// }
//
// Example usage in HTML:
//
// `display: block` sprite:
// <div class="icon-home"></div>
//
// To change `display` (e.g. `display: inline-block;`), we suggest using a common CSS class:
//
// // CSS
// .icon {
//   display: inline-block;
// }
//
// // HTML
// <i class="icon icon-home"></i>
@mixin sprite-width($sprite) {
  width: nth($sprite, 5);
}

@mixin sprite-height($sprite) {
  height: nth($sprite, 6);
}

@mixin sprite-position($sprite) {
  $sprite-offset-x: nth($sprite, 3);
  $sprite-offset-y: nth($sprite, 4);
  background-position: $sprite-offset-x  $sprite-offset-y;
}

@mixin sprite-image($sprite) {
  $sprite-image: nth($sprite, 9);
  background-image: url(#{$sprite-image});
}

@mixin sprite($sprite) {
  @include sprite-image($sprite);
  @include sprite-position($sprite);
  @include sprite-width($sprite);
  @include sprite-height($sprite);
}

// The `sprites` mixin generates identical output to the CSS template
//   but can be overridden inside of SCSS
//
// @include sprites($spritesheet-sprites);
@mixin sprites($sprites) {
  @each $sprite in $sprites {
    $sprite-name: nth($sprite, 10);
    .#{$sprite-name} {
      @include sprite($sprite);
    }
  }
}
